<?php

//菜单相关
Route::group([
    'namespace' => 'App\Http\Controllers\Admin',
    'prefix' => 'admin/menu',
    'middleware' => ['response'],
], function () {
    Route::get('/list', "MenuController@getMenuList");
    Route::get('/tree_list', "MenuController@getMenuTreeList");
    Route::get('/info', "MenuController@getMenuInfo");
    Route::post('/add', "MenuController@addMenu");
    Route::delete('/del', "MenuController@delMenu");
    Route::put('/edit', "MenuController@editMenu");
});

//图片
Route::group([
    'namespace' => 'App\Http\Controllers\Base',
    'prefix' => 'admin/base',
    'middleware' => ['response']
], function() {
    Route::post('/thumb', "ImagesController@thumb");
    Route::post('/upload_image', "ImagesController@uploadImage");
    Route::post('/upload_images', "ImagesController@uploadImages");
});

//七牛
Route::group([
    'namespace' => 'App\Http\Controllers\Api\Qiniu',
    'prefix' => 'admin/qiniu',
    'middleware' => ['response']
], function () {
    Route::post('/upload', "QiniuController@uploadFile");
});

//二维码
Route::group([
    'namespace' => 'App\Http\Controllers\Api\QrCode',
    'prefix' => 'admin/qrcode',
//    'middleware' => ['response']
], function (){
    Route::get('list', "QrCodeController@createQrCode");
});















//系统参数
Route::group([
    'namespace' => 'App\Http\Controllers\Admin',
    'prefix' => 'admin/system_param',
    'middleware' => ['response'],
], function () {
    Route::get('/list', "SystemParamController@getSystemParamList");
    Route::get('/info', "SystemParamController@getSystemParamInfo");
    Route::post('/add', "SystemParamController@addSystemParam");
    Route::delete('/del', "SystemParamController@delSystemParam");
    Route::put('/edit', "SystemParamController@editSystemParam");
});

//redis
Route::group([
    'namespace' => 'App\Http\Controllers\Admin',
    'prefix' => 'admin/redis',
    'middleware' => ['response'],
], function () {
    Route::get('/list', "RedisTextController@text");
    Route::get('/string', "RedisTextController@string");
    Route::get('/list', "RedisTextController@list");
    Route::get('/set', "RedisTextController@set");
    Route::get('/zset', "RedisTextController@zset");
    Route::get('/hash', "RedisTextController@hash");

});

//热门推荐
Route::group([
    'namespace' => 'App\Http\Controllers\Admin',
    'prefix' => 'admin/article',
    'middleware' => ['response'],
], function () {
//    Route::get('/list', "RecommendController@getRecommendList");
//    Route::post('/add', "RecommendController@addRecommend");

    Route::put('/praise', "RecommendController@praiseCount");
    Route::put('/despise', "RecommendController@despiseCount");
    Route::put('/favorites', "RecommendController@favoritesCount");

    Route::put('/add_count', "RecommendController@addCount");
//    Route::put('/praise_count', "RecommendController@praiseCount");


});

/**
 * 文章管理
 */
Route::group([
    'namespace' => 'App\Http\Controllers\Admin\Article',
    'prefix' => 'admin/article',
    'middleware' => ['response', 'auth'],
], function () {
    Route::get('/list', "ArticleController@getArticleList");
    Route::get('/info', "ArticleController@getArticleInfo");
    Route::post('/add', "ArticleController@addArticle");
    Route::put('/edit', "ArticleController@editArticle");
    Route::delete('/del', "ArticleController@delArticle");
});


//会员相关
Route::group([
    'namespace' => 'App\Http\Controllers\Admin\member',
    'prefix' => 'admin/member',
    'middleware' => ['response'],
], function () {
    Route::get('/list', "MemberController@getMemberList");
    Route::get('/info', "MemberController@getMemberInfo");
    Route::post('/add', "MemberController@addMember");
    Route::delete('/del', "MemberController@delMember");
    Route::put('/edit', "MemberController@editMember");
    Route::post('/login', "MemberController@login");
    Route::post('/login_out', "MemberController@loginOut");
});



//商品管理
Route::group([
    'namespace' => 'App\Http\Controllers\Admin\Product',
    'prefix' => 'admin/product',
    'middleware' => ['response', 'auth'],
], function () {
    //spu
    Route::post('/add_spu', "SpuController@addSpu");
    Route::delete('/del_spu', "SpuController@delSpu");
    Route::put('/edit_spu', "SpuController@editSpu");
    Route::put('/edit_spu_status', "SpuController@editSpuStatus");
    Route::get('/spu_list', "SpuController@getSpuList");
    Route::get('/spu_info', "SpuController@getSpuInfo");
});

//尺寸管理
Route::group([
    'namespace' => 'App\Http\Controllers\Admin\Base',
    'prefix' => 'admin/size',
    'middleware' => ['response', 'auth'],
], function () {
    Route::post('/add', "SizeController@addSize");
    Route::delete('/del', "SizeController@delSize");
    Route::put('/edit', "SizeController@editSize");
    Route::get('/list', "SizeController@getSizeList");
    Route::get('/info', "SizeController@getSizeInfo");

});

//标签管理
Route::group([
    'namespace' => 'App\Http\Controllers\Admin\Base',
    'prefix' => 'admin/tags',
    'middleware' => ['response', 'auth'],
], function () {
    Route::post('/add', "TagsController@addTags");
    Route::delete('/del', "TagsController@delTags");
    Route::put('/edit', "TagsController@editTags");
    Route::get('/list', "TagsController@getTagsList");
    Route::get('/info', "TagsController@getTagsInfo");

});

//分类管理
Route::group([
    'namespace' => 'App\Http\Controllers\Admin\Base',
    'prefix' => 'admin/category',
    'middleware' => ['response', 'auth'],
], function () {
    Route::post('/add', "CategoryController@addCategory");
    Route::delete('/del', "CategoryController@delCategory");
    Route::put('/edit', "CategoryController@editCategory");
    Route::get('/list', "CategoryController@getCategoryList");
    Route::get('/info', "CategoryController@getCategoryInfo");

});
